from django.contrib.auth.models import User
from django.db import models


# Create your models here.

class Resume(models.Model):
    resume_name = models.CharField('简历名称', max_length=255)
    name = models.CharField("姓名", max_length=255)
    sex = models.CharField("性别", max_length=255)
    age = models.CharField('年龄', max_length=255)
    expected_salary = models.CharField('期望薪资', max_length=255, null=True)
    phone = models.CharField('联系方式', max_length=255)
    email = models.CharField('邮箱', max_length=255)

    work_experience = models.CharField('工作经验', max_length=200, null=True)
    edu_experience = models.CharField('教育经历', max_length=200, null=True)
    training_experience = models.CharField('培训经历', max_length=200, null=True)
    expected_job = models.CharField('求职意向', max_length=200, null=True)
    additional_info = models.CharField('附加信息', max_length=200, null=True)
    it_skills = models.CharField('it技能', max_length=200, null=True)
    project_experience = models.TextField('项目经验', null=True)

    c_time = models.DateTimeField("创建时间", auto_now_add=True)
    u_time = models.DateTimeField("修改时间", auto_now=True)

    user = models.ForeignKey(to=User, on_delete=models.CASCADE, null=True, verbose_name="简历所属人")


class Job(models.Model):
    job_name = models.CharField("岗位名称", max_length=255)
    address = models.CharField("公司所在地", max_length=255)
    company_name = models.CharField("公司名称", max_length=255)
    experience = models.CharField("经验要求", null=True, max_length=255)
    education = models.CharField("学历要求", max_length=255)
    salary = models.CharField("支付薪资", max_length=255)
    position_info = models.TextField('职位信息', null=True)
    company_welfare = models.TextField('公司福利', null=True)
    email = models.CharField('邮箱', max_length=255, null=True)
    c_time = models.DateTimeField("创建时间", auto_now_add=True)
    u_time = models.DateTimeField("修改时间", auto_now=True)


class Delivery(models.Model):
    resume = models.ForeignKey(to=Resume, on_delete=models.CASCADE, verbose_name='简历id')
    job = models.ForeignKey(to=Job, on_delete=models.CASCADE, verbose_name='岗位id')

    state = models.CharField('投递状态', max_length=50, null=True)

    c_time = models.DateTimeField("创建时间", auto_now_add=True)
    u_time = models.DateTimeField("修改时间", auto_now=True)
